/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package main;

import graphics.Login;
import graphics.MainFrame;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Mattia
 */
public class Launch {
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* 
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold> 
        */

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
                    
            private MainFrame x = new MainFrame();
            private Login login = new Login(x);  
            @Override
            public void run() {

                
                
                Thread p = new Thread(new Runnable() {
                    @Override
                    public void run() {
                        for (int i = 0; true; i++) {
                            if (i > 14) {
                                i = 0;
                            }
                            try {
                                Thread.sleep(50);
                            } catch (InterruptedException ex) {
                                Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
                            }
                            x.Label_Action.setIcon(new javax.swing.ImageIcon(getClass().getResource("/graphics/image/busy-icon" + i + ".png")));
                            // sincronizzazione con l'invio delle statistiche
                        }
                    }
                });
                p.setName("Spinner");
                
                login.setLocationRelativeTo(null);
                login.setVisible(true);
                //p.start();
            }
        });
    }
}
